package com.bridgeintelligent.tag.bulkload.service.batch;

import io.swagger.annotations.Api;
import lombok.AllArgsConstructor;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * Created by JackCheung on 2019/9/23 2:18 AM.
 */
@AllArgsConstructor
@Api(tags = "跑批调用模块")
@RestController
@RequestMapping("api/batch")
public class BatchContoller {


    private BatchService batchService;

    @GetMapping("/doTask")
    public BatchResp detail(String indexName) {
        //跑批后全量导入
        long time = System.currentTimeMillis();
        batchService.doTask(indexName);
        return new BatchResp(0, "自定义标签跑批成功，耗时" + (System.currentTimeMillis() - time) + "ms");
    }
}
